<%@ page import="zjq.day0109.travelTrip.entity.Traveller" %>
<%@ page import="zjq.day0109.travelTrip.dao.TravellerDao" %>
<%@ page import="zjq.day0109.travelTrip.dao.impl.TravellerDaoImpl" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2023/1/9
  Time: 19:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>保存用户信息</title>
    <%
        String name = request.getParameter("name");
        int type = request.getIntHeader("type");
        int price = request.getIntHeader("price");
        String phoneUser = request.getParameter("phoneUser");
        String phone = request.getParameter("phone");
        TravellerDao travellerDao = new TravellerDaoImpl();
        Traveller traveller = new Traveller();
        traveller.setName(name);
        traveller.setType(type);
        traveller.setPrice(price);
        traveller.setPhoneUser(phoneUser);
        traveller.setPhone(phone);
        int addRes = travellerDao.addTraveller(traveller);
        if (addRes>0){
            request.getRequestDispatcher("../../../jsp/zjq/day0110/service.jsp").forward(request,response);
        }else{
            out.print("添加失败！！！");
        }
    %>
</head>
<body>

</body>
</html>
